package psi.common;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * Seesion 拦截器，用于在Controller之外访问Session
 * 
 * @author 李静波
 *
 */
public class SessionInterceptor implements Interceptor {

	public void intercept(Invocation inv) {
		PSISessionKit.set(inv.getController().getSession());

		try {
			inv.invoke();
		} finally {
			PSISessionKit.remove();
		}
	}
}
